home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / serial / callback.001 / callback~ / callback / lib / dbase / writestate.c < prev    next >
C/C++ Source or Header  |  1996-07-23  |  446b  |  23 lines

  1.  
  2. #include "dbase.p"
  3.  
  4. void writestate (int st, unsigned uid)
  5. {
  6.     FILE
  7.         *fstate;
  8.  
  9.     if (getmode() != mode_callback)    /* no callback mode */
  10.     return;
  11.     fstate = xfopen(filename[the_statefile], "w");
  12.  
  13.     fprintf(fstate, "%d %d", st, uid);            /* write state/uid */
  14.  
  15.     log(log_on, "statefile %s: write state %d for %s (uid: %d)",
  16.     filename[the_statefile],
  17.     st,
  18.     username(uid),
  19.     uid);
  20.  
  21.     fclose (fstate);                    /* close state file */
  22. }
  23.